package com.hub.esdemo.service.es;


import com.hub.esdemo.dto.Dog;
import com.hub.esdemo.repository.DogRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @ author 飞天蝙蝠
 * @ date & time 2024/12/28 14:28
 */
@Service
public class DogService {

    @Autowired
    private DogRepository dogRepository;

    public Dog save(Dog dog) {
        return dogRepository.save(dog);
    }

    public Dog getDogById(String id) {
        return dogRepository.findById(id).orElse(null);
    }
}
